var t = getApp(), e = null;

Component({
    properties: {
        prop_goods_info: {
            type: null
        },
        goodsId: {
            type: Number
        },
        goodsType: {
            type: String
        },
        hoet: {
            type: null
        }
    },
    data: {
        money: 0,
        numberKeyBoardClose: function() {
            return e.confirmPay(), !1;
        },
        keyBoardShow: !1,
        passValueArr: [],
        titleBgMode: "hide",
        cservice: {},
        details: {},
        showServicePopup: !1,
        cursorIndex: 0
    },
    lifetimes: {
        attached: function() {
            e = this, wx.setNavigationBarTitle({
                title: "扫码下单"
            }), this.getDetails();
        }
    },
    methods: {
        openService: function() {
            this.setData({
                showServicePopup: !this.data.showServicePopup
            });
        },
        confirmPay: function() {
            return 1 != this.data.details.status ? t.tips("当前收款码已关闭，请联系客服！") : 0 == Number(this.data.money) ? t.tips("付款金额必须大于0") : this.data.passValueArr && "." == this.data.passValueArr[this.data.passValueArr.length - 1] ? t.tips("请输入完整数字") : void wx.navigateTo({
                url: "/packageC/cashier/cashier_pay/cashier_pay?cashier_type=scanning_payment&price=" + this.data.money + "&goods_id=" + this.data.goodsId
            });
        },
        handkeyboardinput: function(t) {
            var e = t.detail.passValueArr;
            this.setData({
                passValueArr: e,
                cursorIndex: e.length,
                money: 0 == e.length ? "0" : e.join("")
            });
        },
        setTopping: function() {
            wx.pageScrollTo({
                scrollTop: 0
            });
        },
        getDetails: function() {
            this.setData({
                details: this.data.prop_goods_info.get_goods,
                cservice: this.data.prop_goods_info.customer_service,
                keyBoardShow: !0
            });
        }
    }
});